home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / CMPLTPAS / STRIPWHT.PAS < prev    next >
Pascal/Delphi Source File  |  1988-09-29  |  880b  |  22 lines

  1. {->>>>StripWhite<<<<-------------------------------------------}
  2. {                                                              }
  3. { Filename : STRIPWHT.SRC -- Last Modified 9/29/88             }
  4. {                                                              }
  5. { This removes the leading whitespace from the string passed   }
  6. { in parameter Target.                                         }
  7. {                                                              }
  8. {     From: COMPLETE TURBO PASCAL 5.0  by Jeff Duntemann       }
  9. {    Scott, Foresman & Co., Inc. 1988   ISBN 0-673-38355-5     }
  10. {--------------------------------------------------------------}
  11.  
  12.  
  13. PROCEDURE StripWhite(VAR Target : String);
  14.  
  15. CONST
  16.   WhiteSpace : SET OF Char = [#7,#8,#10,#9,#12,#13,' '];
  17.  
  18. BEGIN
  19.   WHILE (Length(Target) > 0 ) AND (Target[1] IN Whitespace) DO
  20.     Delete(Target,1,1);
  21. END;
  22.